#include "hmmstatesdialog.h"
#include "ui_hmmstatesdialog.h"

#include <QMessageBox>

HmmStatesDialog::HmmStatesDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::HmmStatesDialog)
{
    ui->setupUi(this);
}

HmmStatesDialog::~HmmStatesDialog()
{
    delete ui;
}


int HmmStatesDialog::getStates() {
	return states_;
}

void HmmStatesDialog::accept() {
	bool ok;
	states_ = ui->stateEdit->text().toInt(&ok);
	if (ok && states_>0) {
		QDialog::accept();
	}
	else {
		QMessageBox::warning(this, tr("Błąd"), tr("Nie podałeś poprawnej ilości stanów."));
	}
}
